/*
Project : Programmable Control of Airflow System for Maintaining Oxygen Saturation in Pre-term infant 
Microcontroller : STM32F4 Discovery (STM32F407VG)
File : task_GUI_connect.c
Deverloper : Phattaradanai Kiratiwudhikul
Reseach & Deverloped by Department of Electrical Engineering, Faculty of Engineering, Mahidol University
*/
//------------------------------------------------------------------------------
#include "FreeRTOS.h"
#include "freeRTOS_priority.h"

#include "semphr.h"
#include "queue.h"

#include "task_GUI_connect.h"
#include "driver_GUI_connect.h"
//------------------------------------------------------------------------------
//Global Variable --------------------------------------------------------------
xQueueHandle *GUI_Queue;
xSemaphoreHandle  GUI_semaphore;
//------------------------------------------------------------------------------
void start_GUI_task (void)
{
  connect_GUI_setup();
  init_task_GUI();
}

//------------------------------------------------------------------------------
void connect_GUI_setup(void)
{
  driver_connect_GUI_config();
}

//------------------------------------------------------------------------------
static uint32_t init_task_GUI (void)
{
  GUI_Queue = xQueueCreate(28, sizeof(uint8_t *)); 

  if (xTaskCreate(Task_GUI, "GUI", configMINIMAL_STACK_SIZE, NULL, GUI_TASK_PRIORITY, NULL) != pdPASS) 
  {
    return (1);
  }
  return 0;
}
//------------------------------------------------------------------------------

void Task_GUI (void *pvParameter)
{
  for( ;; )
  {
    xSemaphoreTake( GUI_semaphore, portMAX_DELAY );
  }
}

// End of File -----------------------------------------------------------------
/*--------------------------------------------------------------------------------------------------
(C) Copyright 2014, Department of Electrical Engineering, Faculty of Engineering, Mahidol University
--------------------------------------------------------------------------------------------------*/